using System.Collections;
using UnityEngine;

public abstract class Tutorial : MonoBehaviour
{
	public enum TutorialType
	{
		ReturnBallFirst = 0,
		ReturnBallMultiple = 1,
		ShowTiming = 2,
		DefenseShotReturn = 3,
		DefenseAndAttackAimShots = 4,
		ShowServe = 5
	}

	public enum MatchEvents
	{
		None = 0,
		MissedServe = 1,
		HumanPlayerHitBall = 2,
		AiPlayerHitBall = 3,
		BallHitTable = 4,
		BallHitNet = 5,
		BallHitFloor = 6
	}

	protected bool skipInitMessage;

	protected TutorialGameType gameType;

	public TutorialType type { get; protected set; }

	protected abstract IEnumerator DoRunTutorial();

	public virtual void Init(TutorialGameType gameType)
	{
		this.gameType = gameType;
	}

	public void RunTutorial()
	{
		StartCoroutine(DoRunTutorial());
	}

	public virtual void OnPlayerHitBall(TableTennisPlayerBase player)
	{
	}

	public virtual void AwardPointTo(TableTennisPlayerBase player, bool isTimeOut)
	{
	}

	public virtual void ShouldRepeatServe(TableTennisPlayerBase player)
	{
	}

	protected Coroutine ShowTutorialNotification(string text, float time)
	{
		return gameType.ui.msgBubble.Read(text, gameType.match.GetPlayer(1).transform.GetChild(0), gameType.msgBubbleOffset, null, time);
	}

	protected Coroutine ShowInstructionBubble(string title, string text)
	{
		return gameType.ui.instructionsBubble.Show(title, text, Color.white, null, gameType.instructionBubbleOffset, null, 9999f);
	}

	public virtual void OnBallHitObject(Vector3 pos, Vector3 vel, HitObjectTag hitObjectTag)
	{
	}
}
